package com.wfh.wfhwx.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wfh.wfhwx.model.dto.WxReplyContentDTO;
import com.wfh.wfhwx.model.dto.WxReplyRulePageQueryRequest;
import com.wfh.wfhwx.model.entity.WxReplyRule;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wfh.wfhwx.model.enums.WxReplyContentTypeEnum;
import com.wfh.wfhwx.model.vo.WxReplyRuleVO;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

/**
* @author fenghuanwang
* @description 针对表【wx_reply_rule(微信公众号回复规则)】的数据库操作Service
* @createDate 2025-06-20 16:23:18
*/
public interface WxReplyRuleService extends IService<WxReplyRule> {

    /**
     * 构建查询条件
     *
     * @param wxReplyRulePageQueryRequest
     * @return
     */
    LambdaQueryWrapper<WxReplyRule> getQueryWrapper(WxReplyRulePageQueryRequest wxReplyRulePageQueryRequest);


    /**
     * 获取分页数据
     * @param wxReplyRulePage
     * @param queryWrapper
     * @return
     */
    Page<WxReplyRuleVO> getPage(Page<WxReplyRule> wxReplyRulePage, LambdaQueryWrapper<WxReplyRule> queryWrapper);

    /**
     * 根据用户的消息匹配回复内容
     * @param appId
     * @param msg
     * @return
     */
    WxReplyContentDTO receiveMessageReply(String appId, String msg);

    /**
     * 根据恢复的内容生成对应的回复消息
     * @param wxMpXmlMessage
     * @param wxReplyContentDTO
     * @param contentTypeEnum
     * @return
     */
    WxMpXmlOutMessage replyByContentType(WxMpXmlMessage wxMpXmlMessage, WxReplyContentDTO wxReplyContentDTO, WxReplyContentTypeEnum contentTypeEnum);
}
